<!DOCTYPE html>
<html lang=en>
<head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="构造函数注入一个A类，它依赖B123456789public class A&amp;#123;	private B b;	public A(B b)&amp;#123;		this.b = b;	&amp;#125;	public void bMethod()&amp;#123;		b.show();	&amp;#125;&amp;#125;  B类12345public class B&amp;#123;	public void show()&amp;#1">
<meta name="keywords" content="Java,笔记,Spring">
<meta property="og:type" content="article">
<meta property="og:title" content="Spring-注入">
<meta property="og:url" content="http:&#x2F;&#x2F;yoursite.com&#x2F;2019&#x2F;10&#x2F;18&#x2F;Spring-%E6%B3%A8%E5%85%A5&#x2F;index.html">
<meta property="og:site_name" content="ECIN&#39;S BLOG">
<meta property="og:description" content="构造函数注入一个A类，它依赖B123456789public class A&amp;#123;	private B b;	public A(B b)&amp;#123;		this.b = b;	&amp;#125;	public void bMethod()&amp;#123;		b.show();	&amp;#125;&amp;#125;  B类12345public class B&amp;#123;	public void show()&amp;#1">
<meta property="og:locale" content="en">
<meta property="og:updated_time" content="2019-11-02T06:57:56.000Z">
<meta name="twitter:card" content="summary">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/favicon-192x192.png" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
          
        
    
    <!-- title -->
    <title>Spring-注入</title>
    <!-- styles -->
    <link rel="stylesheet" href="/css/style.css">
    <!-- persian styles -->
    
      <link rel="stylesheet" href="/css/rtl.css">
    
    <!-- rss -->
    
    
</head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/2019/10/18/Spring%E4%BD%BF%E7%94%A8%E9%85%8D%E7%BD%AE%E7%B1%BB%E6%B3%A8%E5%85%A5%E6%95%B0%E6%8D%AE%E6%BA%90%E8%BF%9E%E6%8E%A5mysql%EF%BC%88%E6%9C%AA%E6%8C%81%E4%B9%85%E5%8C%96%EF%BC%89/"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/2019/10/18/BTSow%20Spider/"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">Previous post</span>
      <span id="i-next" class="info" style="display:none;">Next post</span>
      <span id="i-top" class="info" style="display:none;">Back to top</span>
      <span id="i-share" class="info" style="display:none;">Share post</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/" target="_blank" rel="noopener"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&text=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&is_video=false&description=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=Spring-注入&body=Check out this article: http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/" target="_blank" rel="noopener"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&name=Spring-注入&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&t=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#构造函数注入"><span class="toc-number">1.</span> <span class="toc-text">构造函数注入</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#一个A类，它依赖B"><span class="toc-number">1.0.1.</span> <span class="toc-text">一个A类，它依赖B</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#B类"><span class="toc-number">1.0.2.</span> <span class="toc-text">B类</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Beans-xml"><span class="toc-number">1.0.3.</span> <span class="toc-text">Beans.xml</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Main中"><span class="toc-number">1.0.4.</span> <span class="toc-text">Main中</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#设值函数注入"><span class="toc-number">2.</span> <span class="toc-text">设值函数注入</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#A类，依赖B"><span class="toc-number">2.0.1.</span> <span class="toc-text">A类，依赖B</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#B类-1"><span class="toc-number">2.0.2.</span> <span class="toc-text">B类</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Beans-xml-1"><span class="toc-number">2.0.3.</span> <span class="toc-text">Beans.xml</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#配置类注入"><span class="toc-number">3.</span> <span class="toc-text">配置类注入</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#一个A类，它依赖B-1"><span class="toc-number">3.0.1.</span> <span class="toc-text">一个A类，它依赖B</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#B类-2"><span class="toc-number">3.0.2.</span> <span class="toc-text">B类</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#使用Config类来代替Beans-xml"><span class="toc-number">3.0.3.</span> <span class="toc-text">使用Config类来代替Beans.xml</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Main中-1"><span class="toc-number">3.0.4.</span> <span class="toc-text">Main中</span></a></li></ol></li></ol></li></ol>
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        Spring-注入
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">ECIN'S BLOG</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2019-10-18T12:16:08.000Z" itemprop="datePublished">2019-10-18</time>
        
      
    </div>


      

      
    <div class="article-tag">
        <i class="fas fa-tag"></i>
        <a class="tag-link" href="/tags/Java/" rel="tag">Java</a>, <a class="tag-link" href="/tags/Spring/" rel="tag">Spring</a>, <a class="tag-link" href="/tags/%E7%AC%94%E8%AE%B0/" rel="tag">笔记</a>
    </div>


    </div>
  </header>
  

  <div class="content" itemprop="articleBody">
    <h3 id="构造函数注入"><a href="#构造函数注入" class="headerlink" title="构造函数注入"></a>构造函数注入</h3><h5 id="一个A类，它依赖B"><a href="#一个A类，它依赖B" class="headerlink" title="一个A类，它依赖B"></a>一个A类，它依赖B</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">public class A&#123;</span><br><span class="line">	private B b;</span><br><span class="line">	public A(B b)&#123;</span><br><span class="line">		this.b = b;</span><br><span class="line">	&#125;</span><br><span class="line">	public void bMethod()&#123;</span><br><span class="line">		b.show();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h5 id="B类"><a href="#B类" class="headerlink" title="B类"></a>B类</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">public class B&#123;</span><br><span class="line">	public void show()&#123;</span><br><span class="line">		System.out.println(&quot;This is B show method.&quot;);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h5 id="Beans-xml"><a href="#Beans-xml" class="headerlink" title="Beans.xml"></a>Beans.xml</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&lt;beans&gt;</span><br><span class="line">	&lt;bean id=&quot;A&quot; class=&quot;com.A&quot;&gt;</span><br><span class="line">		&lt;constructor-arg ref=&quot;B&quot;/&gt;</span><br><span class="line">	&lt;/bean&gt;</span><br><span class="line">	&lt;bean id=&quot;B&quot; class=&quot;com.B&quot;&gt;</span><br><span class="line">	&lt;/bean&gt;</span><br><span class="line">&lt;/beans&gt;</span><br></pre></td></tr></table></figure>

<h5 id="Main中"><a href="#Main中" class="headerlink" title="Main中"></a>Main中</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">public class Main&#123;</span><br><span class="line">	public static void main(String[] args)&#123;</span><br><span class="line">        ApplicationContext context = new ClassPathXmlApplicationContext(&quot;Beans.xml&quot;);</span><br><span class="line">        A a = (A)context.getBean(&quot;A&quot;);</span><br><span class="line">        a.show();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h3 id="设值函数注入"><a href="#设值函数注入" class="headerlink" title="设值函数注入"></a>设值函数注入</h3><h5 id="A类，依赖B"><a href="#A类，依赖B" class="headerlink" title="A类，依赖B"></a>A类，依赖B</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">public class A&#123;</span><br><span class="line"></span><br><span class="line">	private B b;</span><br><span class="line">	</span><br><span class="line">	public setB(B b)&#123;</span><br><span class="line">		this.b = b;</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	public B getB()&#123;</span><br><span class="line">		return b;</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	public void bMethod()&#123;</span><br><span class="line">		b.show();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h5 id="B类-1"><a href="#B类-1" class="headerlink" title="B类"></a>B类</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">public class B&#123;</span><br><span class="line">	public void show()&#123;</span><br><span class="line">		System.out.println(&quot;This is B show method.&quot;);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h5 id="Beans-xml-1"><a href="#Beans-xml-1" class="headerlink" title="Beans.xml"></a>Beans.xml</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&lt;beans&gt;</span><br><span class="line">	&lt;bean id=&quot;A&quot; class=&quot;com.A&quot;&gt;</span><br><span class="line">		&lt;property name=&quot;b&quot; ref=&quot;B&quot;/&gt;</span><br><span class="line">	&lt;/bean&gt;</span><br><span class="line">	&lt;bean id=&quot;B&quot; class=&quot;com.B&quot;&gt;</span><br><span class="line">	&lt;/bean&gt;</span><br><span class="line">&lt;/beans&gt;</span><br></pre></td></tr></table></figure>

<h3 id="配置类注入"><a href="#配置类注入" class="headerlink" title="配置类注入"></a>配置类注入</h3><h5 id="一个A类，它依赖B-1"><a href="#一个A类，它依赖B-1" class="headerlink" title="一个A类，它依赖B"></a>一个A类，它依赖B</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">public class A&#123;</span><br><span class="line">	private B b;</span><br><span class="line">	public A(B b)&#123;</span><br><span class="line">		this.b = b;</span><br><span class="line">	&#125;</span><br><span class="line">	public void bMethod()&#123;</span><br><span class="line">		b.show();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h5 id="B类-2"><a href="#B类-2" class="headerlink" title="B类"></a>B类</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">public class B&#123;</span><br><span class="line">	public void show()&#123;</span><br><span class="line">		System.out.println(&quot;This is B show method.&quot;);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h5 id="使用Config类来代替Beans-xml"><a href="#使用Config类来代替Beans-xml" class="headerlink" title="使用Config类来代替Beans.xml"></a>使用Config类来代替Beans.xml</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">@Configuration</span><br><span class="line">public class Config&#123;</span><br><span class="line"></span><br><span class="line">	@Bean</span><br><span class="line">	public A a()&#123;</span><br><span class="line">		return new A(b());</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	@Bean</span><br><span class="line">	public B b()&#123;</span><br><span class="line">		return new B();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h5 id="Main中-1"><a href="#Main中-1" class="headerlink" title="Main中"></a>Main中</h5><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">public class Main&#123;</span><br><span class="line">	public static void main(String[] args)&#123;</span><br><span class="line">        ApplicationContext context= new AnnotationConfigApplicationContext(Config.class);</span><br><span class="line">        A a = (A)context.getBean(A.class);</span><br><span class="line">        a.show();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
  </div>
</article>



        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#构造函数注入"><span class="toc-number">1.</span> <span class="toc-text">构造函数注入</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#一个A类，它依赖B"><span class="toc-number">1.0.1.</span> <span class="toc-text">一个A类，它依赖B</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#B类"><span class="toc-number">1.0.2.</span> <span class="toc-text">B类</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Beans-xml"><span class="toc-number">1.0.3.</span> <span class="toc-text">Beans.xml</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Main中"><span class="toc-number">1.0.4.</span> <span class="toc-text">Main中</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#设值函数注入"><span class="toc-number">2.</span> <span class="toc-text">设值函数注入</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#A类，依赖B"><span class="toc-number">2.0.1.</span> <span class="toc-text">A类，依赖B</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#B类-1"><span class="toc-number">2.0.2.</span> <span class="toc-text">B类</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Beans-xml-1"><span class="toc-number">2.0.3.</span> <span class="toc-text">Beans.xml</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#配置类注入"><span class="toc-number">3.</span> <span class="toc-text">配置类注入</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#一个A类，它依赖B-1"><span class="toc-number">3.0.1.</span> <span class="toc-text">一个A类，它依赖B</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#B类-2"><span class="toc-number">3.0.2.</span> <span class="toc-text">B类</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#使用Config类来代替Beans-xml"><span class="toc-number">3.0.3.</span> <span class="toc-text">使用Config类来代替Beans.xml</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Main中-1"><span class="toc-number">3.0.4.</span> <span class="toc-text">Main中</span></a></li></ol></li></ol></li></ol>
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/" target="_blank" rel="noopener"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&text=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&is_video=false&description=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=Spring-注入&body=Check out this article: http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/" target="_blank" rel="noopener"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&title=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&name=Spring-注入&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2019/10/18/Spring-%E6%B3%A8%E5%85%A5/&t=Spring-注入" target="_blank" rel="noopener"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> Menu</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> TOC</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> Share</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> Top</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy; 2020 ECIN520
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
    <!-- styles -->
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">

    <!-- jquery -->
<script src="/lib/jquery/jquery.min.js"></script>
<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>
<!-- clipboard -->

  <script src="/lib/clipboard/clipboard.min.js"></script>
  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"Copy to clipboard!\">";
    btn += '<i class="far fa-clone"></i>';
    btn += '</span>'; 
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "Copied!");
      e.clearSelection();
    })
  })
  </script>

<script src="/js/main.js"></script>
<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

<!-- Disqus Comments -->


</body>
</html>
